const svc = require('../util/service');

module.exports = (req, res) =>
svc.handlePost(req, res, (reqObj, resolve) => {
	if (reqObj.uploadId != 0 && !reqObj.uploadId) {
		resolve({
			result : -1,
			msg : '缺少uploadId'
		})
		return
	}
	var percentage = 0;
	if (req.session.uploadPercentage && req.session.uploadPercentage[reqObj.uploadId]) {
		percentage = req.session.uploadPercentage[reqObj.uploadId]
	}
	resolve({
		percentage
	})
})
